﻿using DomainService.IService.Sys;
using Infrastructure;
using Infrastructure.IRepository.Sys;
using Model.DomainModel.Sys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DomainService.Service.Sys
{
    /// <summary>
    /// 异常服务接口实现
    /// </summary>
    public class SysExceptionLogService: ISysExceptionLogService
    {
        #region 构造实例化

        /// <summary>
        /// 异常底层仓储
        /// </summary>
        private readonly ISysExceptionLogRepository _sysExceptionLogRepository;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="sysExceptionLogRepository"></param>
        public SysExceptionLogService(ISysExceptionLogRepository sysExceptionLogRepository)
        {
            _sysExceptionLogRepository = sysExceptionLogRepository;
        }

        #endregion

        #region 业务逻辑

        /// <summary>
        /// 新增异常日志
        /// </summary>
        /// <param name="sysExceptionLog"></param>
        public void Insert(SysExceptionLog sysExceptionLog)
        {
            _sysExceptionLogRepository.Insert(sysExceptionLog, BaseSqlRepository.sysExceptionLog_insertSql);
        }

        #endregion
    }
}
